package cn.ekuma.pos.printer.zonerich;

import javax.swing.JComponent;

import net.xeoh.plugins.base.annotations.PluginImplementation;

import com.openbravo.pos.config.ParametersConfig;
import com.openbravo.pos.printer.DevicePrinter;
import com.openbravo.pos.printer.PrinterWritterPool;
import com.openbravo.pos.printer.TicketPrinterException;
import com.openbravo.pos.printer.config.ParametersComm;
import com.openbravo.pos.printer.config.ParametersLan;
import com.openbravo.pos.printer.escpos.ESCPOS;

@PluginImplementation
public class DevicePrinterChinaOEMByLAN  extends AbstractDevicePrinterChinaOEM implements DevicePrinter{

	@Override
	public String getPrinterType() {
		return "ChinaOEM Lan";
	}
	
	public DevicePrinterChinaOEMByLAN() {
	}

	public DevicePrinterChinaOEMByLAN(String sPrinterParam1, String sPrinterParam2) throws TicketPrinterException {
		m_CommOutputPrinter = PrinterWritterPool.INSTANCE.getPrinterWritter(PrinterWritterPool.WRITETYPE_LAN,sPrinterParam1, new Integer(sPrinterParam2));
        m_codes = new CodesZonerichAB58GK();
        m_trans = new UnicodeTranslatorZonerichAB58GK();

        // Inicializamos la impresora
        m_CommOutputPrinter.init(ESCPOS.INIT);
        m_CommOutputPrinter.write(m_trans.getCodeTable());

        m_CommOutputPrinter.flush();  
	}

	public  DevicePrinter init(String sPrinterParam1, String sPrinterParam2) throws TicketPrinterException {	
		return new DevicePrinterChinaOEMByLAN(sPrinterParam1,sPrinterParam2);
	}
	
	
	@Override
	public ParametersConfig getConfiguration() {
		return new ParametersLan();
	}


	protected String m_sName;


	public String getPrinterName() {
	    return m_sName;
	}

	public String getPrinterDescription() {
	    return null;
	}

	@Override
	public JComponent getPrinterComponent() {
		// TODO Auto-generated method stub
		return null;
	}

	
}
